<template>
  <div id="myMap" class="arcMap"></div>
</template>
<script>
import { loadModules } from "esri-loader";
export default {
  name: "ocnGisMap",
  data() {
    return {};
  },
  computed: {},
  created() {},
  mounted() {
      this.createView();
  },
  methods: {
    
    /**
     * @author QL
     * @functionName createView
     * @param { - } 
     * @date 2021-12-28 16:52:41
     * @version V..
     * @description 创建地图的视图区域
     */
    createView() {
      let options = {
        url: "https://js.arcgis.com/4.15/",
        css: "https://js.arcgis.com/4.15/esri/themes/light/main.css",
      };


      loadModules(["esri/Map", "esri/views/SceneView"], options).then(
        ([Map, SceneView]) => {
          let map = new Map({
            basemap: "streets",
            ground: "world-elevation",
          });

          let view = new SceneView({
            container: "myMap", // Reference to the DOM node that will contain the view
            map: map, // References the map object created in step 3
          });

          this.$utils.setConsole("底图挂载：", view);
        }
      );
    },
  },
};
</script>
<style lang="scss" scoped>
.arcMap {
  background-color: #ffffff;
  height: 100%;
  margin: 2px;
  border-radius: 6px;
  /* stretch 属性标识按照对称轴垂直方向沾满容器 前提是容器没有设置对称轴垂直方向的距离属性 width/height*/
  align-self: stretch;
}
</style>